====== Developing Applications for MIOS ======

Developing custom applications for [[MIOS]]-driven Pic-Chips is very easy and straightforward:

{{http://www.audiocommander.de/pics/sonst/MIOS_Overview.gif}}

This page covers the **APPLICATION** part as seen above.

When coding your app in C, you can include a set of MIOS-enhanced SDCC-Libraries (-> [[http://www.ucapps.de/mios/mios_libsdcc_v2_5_0.zip|mios_libsdcc_v2_5_0.zip]]), but this will increase the code size(!).

If you stick to the provided functions coming with MIOS, you just have to learn the C-Syntax which is very easy. If you ever programmed in any other (also scripting-) language, you might be able to learn the syntax in just a few hours and start programming like a pro!

As you can also program in Assembler and don't know which language to choose: 
Technically spoken, you are free to choose whatever language you like, C, ASM or [[how_to_mix_c_and_asm|mix it]] only when necessary. But be aware: the learning curve for ASM is very steep, and if you don't need to squeeze out the very last mililisecond or spare another byte, __it is recommended to code in C__. 


**Hint for beginners**: You will soon find out, that it's no problem to add and subtract; it's slightly more difficult to multiply, but actually very complex to divide.
One possibility to avoid multiplications and divisions (beside the use of ASM code snippets inside the C-Code) is the intelligent use of bitshifting techniques. So buy yourself a good C book or find a webpage and read carefully about bitshifting operations.



\\
\\
\\

====== Coding in C ======

  * [[http://www.ucapps.de/mios_c.html|C Interface & Examples]] <sup>uCApps</sup>
  * [[http://www.ucapps.de/cmios_fun.html|Function Reference List]] <sup>uCApps</sup>
\\
  * [[MBHP acronyms]] <- Abbreviations overview for a better understanding of the Function Reference List

  * [[C Tips and Tricks for PIC Programming]]


\\
\\
\\




====== Setup & Install ======

  *Windows
    * Part 1 - [[windows_toolchain_core|Setup the core software toolchain for MIOS application development on Windows]] - These are the minimal Windows applications you need, to write a MIOS Application in C for your MIDIbox.
    * Part 2 - [[windows_toolchain_ASM_ACSim|Extend your toolchain with MinGW to build the AC-Sim DOS C Simulator, or MPASM for ASM coding]] - These lesser-used options are both still important in certain situations. You will need MPASM if you would like to write applications in PIC ASM, or if you want to edit TK's ASM apps. MinGW is used to build the AC-Sim simulator, which is helpful for testing complex algorithms within your applications, without the need to upload to your MIDIbox. If you are likely to use this, it is recommended that you install MinGW prior to Code::Blocks.
    * Part 3 - [[windows_toolchain_codeblocks|Extend your toolchain with Code::Blocks and GDB]] - Code::Blocks is an IDE which has several helpful features when developing applications, such as code highlighting, code completion, and debugging.
\\
  *Macintosh
    * [[Installing GPUTILS and SDCC on OSX]] -- step-by-step tutorial & download links
    * [[How to use Xcode2 as IDE on a Mac]] -- step-by-step tutorial
\\
  *Linux
    * [[Installing GPUTILS and SDCC on Gentoo Linux]] -- step-by-step tutorial
    * [[howto_app_dev_eclipse_ide|Developing MIOS Apps with Eclipse]] -- step-by-step tutorial & download links
    * [[Installing GPUTILS and SDCC on Fedora Core 5]] -- step-by-step tutorial

\\ 
  *Platform independent
    * [[howto_app_dev_eclipse_ide|Developing MIOS Apps with Eclipse]] -- step-by-step tutorial & download links
    * [[MIOS C Simulator - Debugger|ACSim]] <in development> - Debug and simulate your C-Application in a graphical UI before uploading it to the Core!

\\
\\
\\

====== Coding in ASM ======

  * [[http://www.ucapps.de/mios_fun.html|ASM Function Reference List]] <sup>uCApps</sup>

  * [[http://www.ucapps.de/howto_tools_mpasm.html|HowTo use MPASM]] <sup>uCApps</sup>
  * [[http://www.ucapps.de/howto_tools_mplab.html|Short MPLAB Guide]] <sup>uCApps</sup>


  * [[Compiling the MIDIbox source on Linux]] - using GPASM (Linux, Mac) instead of MPLAB (Windows)


\\
\\
\\

====== Important documents for both C and ASM ======

  * [[MIOS Pin List|MIOS I/O Pin usage in wiki format]] or [[http://www.ucapps.de/mios/mios_pin_list.txt|Official MIOS I/O pin usage text file]] <sup>uCApps</sup>
  * [[http://www.ucapps.de/mios/mios_ram_handling.txt|MIOS RAM Handling]] <sup>uCApps</sup>

  * [[Using PIC18F4620]] – How to use the newer PIC18F4620 with a lot more cool features together with MIOS v1.9
  * [[Using PIC18F4685]] – How to use the newer PIC18F4685

  * [[How to mix C and ASM]] – optimizing code: using plain ASM in a C-Based project

  * [[LCD Offsets]] - How MIOS LCD Offsets work with various display types
  * [[Character LCDS]] - find there the link to the famous special character creator of Cpt. Hastings
  * [[Graphical LCDS]] - find there the link to the famous GLCD character creator of Cpt. Hastings



\\
\\